// 继承的时候权限只能往下降低 private -> protected -> public
class User {
  public name: string;
  age: number //默认就是public
  protected hobby: string = 'sleep' //只能在类中访问和继承
  private self: string = 'hh' //只能在类中访问且不能被继承
  constructor(n: string, a: number) {
    this.name = n;
    this.age = a;
  }
  info(): string {
    return `${this.name}的年龄是${this.age}`;
  }
  getHobby(): string {
    return this.hobby + this.self
  }
}

// 属性是独有的 方法是在原型上的
const user = new User('coderzrf', 22)
const zrf = new User('zrf', 23)
console.log(user.info());

const users: User[] = []
users.push(zrf, user)

// 修饰符

